package com.bwf.set;

import java.util.Comparator;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/24 9:46
 * @Copyright 博为峰
 */
//比较器
public class ComparatorImpl implements Comparator<Worker> {
    /*@Override
    public int compare(Object o1, Object o2) {
        final Worker s1 = (Worker) o1;
        final Worker s2 = (Worker) o2;
        return s1.getAge() - s2.getAge();
    }*/

    @Override
    public int compare(Worker o1, Worker o2) {
        return o1.getAge() - o2.getAge();
    }
}
